cc.Class({
    extends: cc.Component,

    properties: {
        txtPhase: cc.Label,
        imgPos1: cc.Node,
    },

    onLoad () {
        this.imgPos1.parent = null;
    },

    init(data) {
        this.txtPhase.string = data.phase.substr(4, data.phase.length - 4);
        var info = data.bikeInfos;
        var childs = this.node.children;
        for(var i in info) {
            if(info[i].rank == 1) {
                this.imgPos1.parent = childs[info[i].bikeId];
                break;
            }
        }
    }
});
